Shmuel Melamud [Tue, 9 Jan 2024 02:51:31 +0000 (04:51 +0200)]
st/drawing-area: Merge ClutterCanvas to StDrawingArea
Since StDrawingArea is the only user of ClutterCanvas, it is possible
to move ClutterCanvas completely out of Mutter to gnome-shell. This
allows to remove another Cairo dependency from Mutter.
This patch merges ClutterCanvas code extracted from Mutter to
StDrawingArea.
Whether or not switches include shapes to indicate their ON/OFF
state is currently controlled by the stylesheet.
However there are use cases for both using the HighContrast style
without shapes, and for using shapes with the regular styesheet,
so follow the newly added "show-status-shapes" setting instead.
Florian Müllner [Wed, 10 Jan 2024 18:45:59 +0000 (19:45 +0100)]
popupMenu/switch: Use icons for state indicators
The indicators are currently part of the background image in the
high contrast theme. Using symbolic icons instead allows separating
the switch shapes from the high-contrast setting in the future.
Barnabás Pőcze [Tue, 16 Jan 2024 22:41:24 +0000 (23:41 +0100)]
status/backlight: Do only one dbus call per local change
The values of the two control widgets are syncronized, meaning
that both emit signals when the local value changes, regardless
which one is visible and is actually used by the user.
This is not ideal because it leads to two dbus calls
per local change. To alleviate this, only consider
changes from the widget that is visible.
The logic could enter an infinite loop because it tried to
propagate local changes to g-s-d that were caused by signals sent
by g-s-d. For example:
1. slider is set to 50
2. Set(50) dbus call is sent
3. slider is set to 51
4. Set(51) dbus call is sent
5. PropertiesChanged arrives due to Set(50)
6. this._sliderItem.value is set to 50
7. notify::value is emitted from this._sliderItem
8. Set(50) dbus call is sent
9. PropertiesChanged arrives due to Set(51)
10. this._sliderItem.value is set to 51
11. notify::value is emitted from this._sliderItem
12. Set(51) dbus call is sent
To alleviate this issue, block signal handlers when the local state is
changed due to a remote event.
Sam Hewitt [Mon, 15 Jan 2024 14:09:42 +0000 (10:39 -0330)]
style: Add lockscreen style to entry drawing mixin
- include style condition to entry drawing mixin to accommodate transparent bg on lockscreen
- see https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6802 and https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3109#note_1970652
Florian Müllner [Mon, 15 Jan 2024 13:39:59 +0000 (14:39 +0100)]
closeDialog: Close existing dialogs on shutdown
Otherwise mutter will request to hide the dialog when the meta
context is destroyed, but at the JS context has already shut down,
resulting in a crash.
Close https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7328
It can be fairly tedious to enter a toolbox and invoke `meson test`
with the right build directory, so add a companion script to the
existing meson-build.sh to handle that.
Florian Müllner [Fri, 12 Jan 2024 13:28:03 +0000 (14:28 +0100)]
tools/toolbox: Expose --wipe meson flag
It's useful when the existing build directory became invalid,
for instance after a meson update, and exposing it directly
from the wrapper script is more convenient than removing the
directory or entering the toolbox manually to invoke meson.
Florian Müllner [Fri, 12 Jan 2024 13:37:27 +0000 (14:37 +0100)]
tools/toolbox: Consistently abort on failure
Unlike the other scripts, meson-build currently doesn't set
the `-e` option. The script is mainly a wrapper around a single
toolbox call, but it means that any errors during option parsing
print a warning, but are otherwise ignored.
Florian Müllner [Thu, 11 Jan 2024 18:01:46 +0000 (19:01 +0100)]
tests: Add fittsy test
Both the dash and top bar items are expected to extend to the
screen edge, to make them easier click targets according to
Fitts' law.
This has the tendency to break fairly regularly, so add a small
test that checks the Fittsiness of the show-apps and activities
buttons to catch regressions.
Sam Hewitt [Thu, 11 Jan 2024 23:12:08 +0000 (19:42 -0330)]
style: Fix panel and dash to account for mouse travel
- rework overview-icon styles for the dash so they extend to the edge of the screen once again
- revert changes to panel_button mixin
- rework panel_button mixin to be more flexible
- fixes #7318
Florian Müllner [Thu, 11 Jan 2024 15:22:38 +0000 (16:22 +0100)]
notificationDaemon: Stop special-casing Empathy
Our telepathy component has been optional for years, and it is
disabled by default on major distros, so we cannot assume that
it handles any particular notifications.
Plus Empathy itself is mostly dead, so it's unlikely to be used
much anymore anyway.
Sam Hewitt [Thu, 11 Jan 2024 01:51:11 +0000 (22:21 -0330)]
style: Refactor the button and entry drawing css
- use a single button mixin for all buttons with a saner 'style' parameter
- rework the entry mixins to be similar to the buttons'
- clear out all unused or deprecated mixins
- create some drawing functions for focus ring and high contrast inset
- replace instances of old mixins with the new
Now that xdg-desktop-portal-gnome implements the Access portal
interface, GNOME Shell doesn't have to be the portal backend for
that anymore.
The D-Bus implementation is still preserved, because internally,
xdg-desktop-portal-gnome may still proxy the Access call to GNOME
Shell when the parent window is not available. That's a private
exchange between xdg-desktop-portal-gnome and GNOME Shell though,
and doesn't require GNOME Shell to be a full portal backend.
See https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome/-/merge_requests/140
Florian Müllner [Thu, 4 Jan 2024 13:39:45 +0000 (14:39 +0100)]
mountOperation: Close when drive gets disconnected
If the volume that corresponds to the mount operation has an
associated drive, we should withdraw any pending dialogs or
notifications when the drive gets physically disconnected,
as they've become obsolete.
Close https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7302
Sam Hewitt [Tue, 9 Jan 2024 18:36:59 +0000 (15:06 -0330)]
calendar: Stylesheet follow-ups and fixes
- drop extraneous calendar-day style_class on week headings
- fix wrong variable in insensitive button mixin
- add some missing focus styles to calendar month header
- fix the asset for today with-events in light theme
- adjust HighContrast visuals for other month days
- make pager buttons circular
Sam Hewitt [Mon, 8 Jan 2024 17:35:09 +0000 (14:05 -0330)]
style: Clean up color definitions and High Contrast
- clean out unused colors; add desaturated light color
- remove long unused drawing functions; add high contrast color mixin
- de-duplicate and move common colors to a default-colors stylesheet
- rework how HighContrast is defined; clean up HC cruft
- bring over named color defines and other colors from libadwaita
- change how panel colors are defined
Sam Hewitt [Fri, 22 Dec 2023 14:47:27 +0000 (11:17 -0330)]
style: Fix HighContrast issues with notifications
- define a new hc_mix_color for mixing functions that was making bg color transparent
- fix missing HC outline on banner notifications
- fix notification timestamp not changing in HC due to color
- closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7283
build: Enable no-omit-frame-pointer for all non-plain builds
To mirror Mutter.
This is useful for local installations with e.g. the `release`
buildtype.
Further more, Fedora has been doing the same system wide and it
apparently was helpful in various ways.
Sam Hewitt [Mon, 18 Dec 2023 15:15:28 +0000 (11:45 -0330)]
style: Update panel styles to use appropriately contrasty text color
- new always light fg color definition
- update panel button style to use new fg color
- fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7270
Florian Müllner [Fri, 5 Jan 2024 09:52:08 +0000 (10:52 +0100)]
extensions-app: Only change state if necessary
The `state-set` signal is emitted to change the underlying state,
which can have two reasons:
1. the user toggled the switch
2. the extension's `enabled` state changed externally
In the second case, calling enable/disable is pointless at best,
and can mess up the expected state by permanently disabling an
extension that was disabled because of the global kill switch.
Address this by only calling enable/disable if the new state does
not already match the current value of the `enabled` property.
Close https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7305
Fixes: fec523f83f ("extensions-app: Use new 'enabled' property")
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3090>
Sebastian Wick [Fri, 15 Dec 2023 15:36:47 +0000 (16:36 +0100)]
lookingGlass: Use Cogl.Pipeline.new to construct new pipelines
new Cogl.Pipeline now constructs a GObject via g_object_new and not via
cogl_pipeline_new. Construction via g_object_new requires a some
construct only parameters so either way, this call doesn't work anymore.
Florian Müllner [Fri, 5 Jan 2024 10:46:59 +0000 (11:46 +0100)]
shell/util: Drop unused capture_images() function
It hasn't been used since commit 757e4b6731, so drop it. This
also avoids a warning when generating the typelib that was
introduced in commit f48729f6e.
Philip Chimento [Mon, 1 Jan 2024 00:13:25 +0000 (19:13 -0500)]
init: Improve error message formatting
Instead of manually formatting the error message and stack, use the same
formatting mechanism as we do when displaying errors to the user that
occur while opening extension preferences. This should correctly
indicate where syntax errors from imported modules occur.
Philip Chimento [Wed, 3 Jan 2024 00:24:13 +0000 (16:24 -0800)]
main: Improve error formatting in logError()
We override GJS's default logError(). This adds the improved formatting
of error stack traces that gjs-console would otherwise do as part of
logError().
Philip Chimento [Wed, 3 Jan 2024 00:16:00 +0000 (16:16 -0800)]
js: Add utility to improve error message formatting
Previously, when we formatted SyntaxErrors with toString(), they
wouldn't display the file/line/column where the syntax error occurred.
This adds a utility function that performs a more comprehensive
formatting that displays location information for SyntaxErrors, as well
as the .cause property of the error if it is present. This formatting is
equivalent to what we do in gjs-console when logging an error.
Florian Müllner [Thu, 21 Dec 2023 20:06:20 +0000 (21:06 +0100)]
extensions-tool/list: Use new `enabled` property for filtering
The new property is a better match for the `--enabled`/`--disabled`
flags, not least because both are used for completions to the
`enable` and `disable` commands.
Florian Müllner [Tue, 19 Dec 2023 23:17:29 +0000 (00:17 +0100)]
extensions-app: Add compat code for older shell versions
The Extensions app is also distributed as flatpak, so we cannot
assume that its version matches the shell. In order to not show
all extensions as disabled when running under a shell version that
doesn't include the `enabled` property yet, add a fallback based
on the current state.
The switch for enabling/disabling extensions currently bases its
state on the extension's ACTIVE state.
This is problematic in the enabled-but-inactive case, because
activating the switch tries to change the state from off to on,
which leads to enabling an already enabled extension (an obvious
no-op).
The new `enabled` property allows us to do better, and use delayed
state changes where the switch position represents the `enabled`
state, and the trough color whether the extension is ACTIVE.
Florian Müllner [Tue, 19 Dec 2023 23:02:35 +0000 (00:02 +0100)]
extensionSystem: Allow changing extensions in ERROR state
While an extension's actual state can no longer change once it is
in ERROR state, its requested state can. In fact, disabling an
erroneous extension is highly recommended, so that it doesn't cause
problems again on the next login.
Unlike `state` which represents the actual state, the new property
reflects the desired state, i.e. whether an extension should be
enabled according to the settings.
The Extension app will soon use it to improve its handling of the
case where the two mismatch (e.g. extension errors).
Florian Müllner [Thu, 21 Dec 2023 17:59:33 +0000 (18:59 +0100)]
extensionSytem: Rename ENABLED/DISABLED states
The ENABLED state means that an extension's `enable()` method
was called successfully.
This usually matches whether an extension *should* be enabled
according to the enabled-extensions/disabled-extensions settings,
but not necessarily: If an extension had an error or does not
support the currently active mode, its actual state is different.
We currently only expose the actual state to external tooling,
but whether an extension should be enabled is relevant as well,
for example to disable a lock-screen only extension from the
regular session.
For that purpose we will expose a separate `enabled` property.
To avoid confusion with the existing states, change the exposed
names to (IN)ACTIVE.
This does not affect the D-Bus API, as the numeric values of
the states remain unchanged.
Florian Müllner [Wed, 21 Jun 2023 15:47:13 +0000 (17:47 +0200)]
animation: Use appropriate spinner asset in light variant
Ideally we would replace the sliced-image based animation with a
themed `process-working-symbolic` icon and rotate it, so the spinner
simply picks up the current foreground color.
Unfortunately the `repeat-count` property does not work for rotations,
so to fix the broken spinner in the light variant
in the meantime, include assets for both variants and swap them
out at runtime.
Not everything in the light variant is actually light (overview,
OSDs, ...), so use a simple heuristic on the text color to decide
which asset to use.
Close https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6783
Florian Müllner [Sun, 24 Dec 2023 10:11:14 +0000 (11:11 +0100)]
animation: Save file and dimensions in properties
The properties passed to the constructor are currently used
directly in anonymous functions. Store them in properties
instead, so they become accessible outside the constructor,
including for changing them.
Sabri Ünal [Sat, 23 Dec 2023 21:39:32 +0000 (00:39 +0300)]
extensions-app: Restore developer_name
The newly added developer name syntax appears not implemented
across related platforms: GNOME Software, Flathub, etc.
There is no harm in using both deprecated and newly introduced
tags together, and neither appstream-glib nor appstreamcli
fails to validate this usage.
Sabri Ünal [Thu, 21 Dec 2023 15:58:16 +0000 (18:58 +0300)]
extension-app: Improve appdata for AppStream 1.0
- Use the `<developer><name>` tag instead of the deprecated `<developer_name>`
- Implement appstreamcli for extra appdata validation
- Fix a release description
- Update the donation URL
- Add the translation tag
The new InteractiveScreenshot() D-Bus method is implemented using
the signals introduced by the previous commit, and is fundamentally
very simple: take the screenshot, and return the GFile URI.
These signals will let the yet to be introduced D-Bus method to
be notified of when either a screenshot has been taken, or if
the screenshot UI has been closed without taking a screenshot.
Add a screenshot-exclusive mode that makes the screencast button
unreactive, and therefore disables screencasting. It doesn't change
the visibility of the button though, as that's done by the codepath
that checks if screencasting is supported.
This will be used by the D-Bus callback to take interactive
screenshots.
screenshot: Make captureScreenshot() return the GFile
Make the captureScreenshot() auxiliary function return the GFile at
which the texture was saved. This file will be used to return the
screenshot URI to the new D-Bus method to take interactive
screenshots.
Florian Müllner [Wed, 20 Dec 2023 13:32:31 +0000 (14:32 +0100)]
extensions-app: Overhaul search
Instead of awkwardly filtering two different lists, use a separate
search page that filters a single list, similar to what libadwaita
does for preference windows.
Florian Müllner [Tue, 19 Dec 2023 01:35:33 +0000 (02:35 +0100)]
extensions-app: Bind actions' enabled properties
Most properties that determine the availability of an action are
not expected to change, but now that extensions are represented
as a GObject, we can just generically set up bindings for all
actions instead of explicitly tracking the properties that we
expect to change.